﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Kotonoha.Server.Core.Utils;
using Kotonoha.Server.Db.Dao;
using NHibernate;

namespace Kotonoha.Server.UI.BadCards {
    /// <summary>
    /// Interaction logic for BadCardsForm.xaml
    /// </summary>
    public partial class BadCardsForm : Window {
        public BadCardsForm() {
            InitializeComponent();
        }

        private void Get20_Click(object sender, RoutedEventArgs e) {
            FlowDocument doc = new FlowDocument();
            BadCardsDao dao = new BadCardsDao(HibernateUtil.Model.Session);
            List<BadWordProxy> badWords = dao.listBadWords(20);
            foreach (var badWord in badWords) {
                doc.Blocks.Add(new BlockUIContainer(new BadCard() {DataContext = badWord}));
            }

            viewer.Document = doc;
        }
    }
}
